<?php

namespace App\Api\V1\Requests\Boilerplate;

use Dingo\Api\Http\FormRequest;

class LoginRequest extends FormRequest
{
    public function rules()
    {
        return [
            'username' => 'required',
            'password' => 'required'
        ];
    }

    public function authorize()
    {
        return true;
    }

    public function messages()
    {
        return [
            'username.required' => trans('validation.required', ['attribute' => '用户名或者邮箱']),
            'password.required' => trans('validation.required', ['attribute' => '密码']),
        ];
    }

}
